import { createApp } from 'vue'
import './clear.less'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import { router } from './router/index'
import App from './App.vue'
import { createPinia } from 'pinia'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)

// 挂载element-plus全部图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
app.use(createPinia())      // 挂载pinia
app.use(router)             // 挂载路由
import "@/router/permission.js" // 挂载路由守卫
app.use(ElementPlus)        // 挂载element-plus组件库
import 'nprogress/nprogress.css' // 挂载nprogress进度条样式
import permission from '@/directives/permistion'
app.use(permission)         // 挂载权限指令
app.mount('#app')

